﻿<phone:PhoneApplicationPage x:Class="WPNEXT.Views.SimpleWallPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:Cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                            xmlns:WpNext="clr-namespace:WPNextTools.NControls;assembly=WPNextTools"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            DataContext="{Binding Simple,
                                                  Source={StaticResource Locator}}"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            Orientation="Portrait"
                            SupportedOrientations="Portrait"
                            d:DesignHeight="800"
                            d:DesignWidth="480"
                            shell:SystemTray.IsVisible="False"
                            mc:Ignorable="d">

    <!--  LayoutRoot is the root grid where all page content is placed  -->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.9*" />
            <RowDefinition Height="0.1*" />
        </Grid.RowDefinitions>
        <Grid Margin="20,0">
            <WpNext:PhotoListBox x:Name="SimpleWall"
                                 EmptyContent="没有数据..."
                                 HeaderContent="松开可以刷新..."
                                 ItemsSource="{Binding Items}"
                                 LoadingContent="加载中..."
                                 ScrollViewer.VerticalScrollBarVisibility="Hidden">
                <WpNext:PhotoListBox.StrategyDefinition>
                    <WpNext:PhotoVirtualizationStrategyDefinition ColumnCount="3"
                                                                  ColumnMargin="5"
                                                                  LeftRightMargin="20"
                                                                  Orientation="Vertical" />
                </WpNext:PhotoListBox.StrategyDefinition>
                <WpNext:PhotoListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Background="Gray">
                            <Image Source="{Binding Url}" />
                        </Grid>
                    </DataTemplate>
                </WpNext:PhotoListBox.ItemTemplate>
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="ScrolledToBottom">
                        <Cmd:EventToCommand Command="{Binding GetDataCommand}" />
                    </i:EventTrigger>
                    <i:EventTrigger EventName="StretchedFromTop">
                        <Cmd:EventToCommand Command="{Binding ResetDataCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </WpNext:PhotoListBox>
        </Grid>
        <Button x:Name="Jump"
                Grid.Row="1"
                Background="Black"
                Click="Jump_Click"
                Content="跳转到其他页"
                Foreground="White" />

    </Grid>

    <!--  Sample code showing usage of ApplicationBar  -->
    <!--
        <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
        <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
        <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
        <shell:ApplicationBar.MenuItems>
        <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
        <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
        </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        </phone:PhoneApplicationPage.ApplicationBar>
    -->

</phone:PhoneApplicationPage>
